<?php defined('SYSPATH') or die('No direct script access.') ;
/**
 * Helper 基础类
 *
 * @author  Yellow.Chow <aultoale@gmail.com>
 * @version $Id: helper.php 213 2012-05-24 09:33:22Z yellow.chow $
 * @license http://www.gnu.org/licenses/gpl-3.0.html    GPL 3
 */
abstract class Helper
{

    /**
     * Create a new helper instance.
     *
     *     $helper = Helper::factory($name);
     *
     * @param   string   helper name
     * @return  Helper
     */
    public static function factory($name)
    {
        // Add the helper prefix
        $class = 'Helper_'.$name;

        if ( ! class_exists($class))
        {
            throw new Payment_Exception('不支持的 Helper 类 :class',
                array(':class' => $class));
        }

        return new $class;
    }

}